package com.example.demo.niuke;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @Author: liull
 * @Description: 字符串加解密
 * @Date: Created in 17:01 2020/4/2
 * @Modified By:
 */
public class Main49 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            String line2 = br.readLine();
            System.out.println(encrypt(line));
            System.out.println(decrypt(line2));
        }
    }

    /**
     * 加密
     *
     * @param line
     * @return
     */
    private static String encrypt(String line) {
        StringBuilder res = new StringBuilder();
        for (int i = 0; i < line.toCharArray().length; i++) {
            // 先处理小写
            if ('a' <= line.charAt(i) && line.charAt(i) <= 'z') {
                if (line.charAt(i) == 'z') {
                    res.append("A");
                } else
                    res.append((char) (line.charAt(i) - 32 + 1));
            } else if ('A' <= line.charAt(i) && line.charAt(i) <= 'Z') {
                if (line.charAt(i) == 'Z') {
                    res.append("a");
                } else
                    res.append((char) (line.charAt(i) + 32 + 1));
            } else if ('0' <= line.charAt(i) && line.charAt(i) <= '9') {
                if (line.charAt(i) == 9) {
                    res.append("0");
                } else
                    res.append((char) (line.charAt(i) + 1));
            } else
                res.append(line.charAt(i));
        }
        return res.toString();
    }

    /**
     * 解密
     *
     * @param line
     * @return
     */
    private static String decrypt(String line) {

        StringBuilder res = new StringBuilder();
        for (int i = 0; i < line.toCharArray().length; i++) {
            // 先处理小写
            if ('a' <= line.charAt(i) && line.charAt(i) <= 'z') {
                if (line.charAt(i) == 'a') {
                    res.append("Z");
                } else
                    res.append((char) (line.charAt(i) - 32 - 1));
            }
            // 再处理大写
            else if ('A' <= line.charAt(i) && line.charAt(i) <= 'Z') {
                if (line.charAt(i) == 'A') {
                    res.append("z");
                } else
                    res.append((char) (line.charAt(i) + 32 - 1));
            }
            // 处理数字
            else if ('0' <= line.charAt(i) && line.charAt(i) <= '9') {
                if (line.charAt(i) == 0) {
                    res.append("9");
                } else
                    res.append((char) (line.charAt(i) - 1));
            } else
                res.append(line.charAt(i));
        }
        return res.toString();
    }
}
